//
//  F37ViewController.m
//  Qihuo
//
//  Created by Vencoo on 13-11-5.
//  Copyright (c) 2013年 Vencoo. All rights reserved.
//

#import "F37ViewController.h"
#import "F37StateObj.h"
@interface F37ViewController ()

@end

@implementation F37ViewController
@synthesize zhengChangB;
@synthesize guZhangB;
@synthesize remarks;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        dataArr = [[NSMutableArray alloc]init];
        floorID = 0;
        readyNumber = 0;
    }
    return self;
}

- (void)viewDidLoad
{
    self.title = @"37F巡检";
    [super viewDidLoad];
    [self addMyArray];
	// Do any additional setup after loading the view.
    [self getFloorInfo];
    [self addNewRightButton];
    [self addDataArray];
    [self initStateView];
    [self sendRequest];
    [self sendConferenceRequest];
    self.title = @"37F巡检";
}

#pragma mark - UITableViewDelegate
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    if (tableView ==self.myTableView) {
        return 0;
    }else
        return 50;
}
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    if (tableView==self.myTableView) {
        return nil;
    }else
    {
        if (_duiZhaoArray.count>3)
        {
            switch (section) {
                case 0:
                    return @"西餐厅";
                    break;
                case 1:
                    return @"贵宾厅";
                    break;
                case 2:
                    return @"咖啡吧";
                    break;
                case 3:
                    return @"桌上托盘内";
                    break;
                case 4:
                    return @"中餐厅";
                    break;
                case 5:
                    return @"走廊(中餐厅)";
                    break;
                default:
                    return @"电梯厅";
                    break;
            }
            
        }else
            return nil;
    }
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (tableView==self.myTableView) {
        return self.leftTableImage.size.height;
    }else
        return 50;
    
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    if (tableView==self.myTableView) {
        return 1;
    }else
        return [_duiZhaoArray count];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    [super tableView:tableView numberOfRowsInSection:section];
    if (tableView==self.myTableView) {
        return [self.allShowDataArr count];
    }else {
        return [[[_duiZhaoArray objectAtIndex:section] objectForKey:@"goodsName"]count];
    }
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    [super tableView:tableView  cellForRowAtIndexPath:indexPath];
    if (tableView==self.myTableView) {
        if (indexPath.row < self.xunJianCellInfos.count) {
            NSDictionary *dic = [self.xunJianCellInfos objectAtIndex:indexPath.row];
            if ([[dic valueForKey:@"hidden"]boolValue] == NO)
            {
                self.mycell.gouView.hidden = NO;
            }
        }
        
        self.mycell.textLabel.text =[self.allShowDataArr objectAtIndex:indexPath.row];
        return self.mycell;
    }else
    {
        F37Cell *cell=[tableView dequeueReusableCellWithIdentifier:@"f37cell"];
        if (!cell) {
            cell =[[[NSBundle mainBundle]loadNibNamed:@"F37Cell" owner:self options:nil]lastObject];
        }
        cell.namelabel.text =[[[_duiZhaoArray objectAtIndex:indexPath.section] objectForKey:@"goodsName"]objectAtIndex:indexPath.row];
        cell.numLabel.text =[[[_duiZhaoArray objectAtIndex:indexPath.section] objectForKey:@"num"]objectAtIndex:indexPath.row];
        return cell;
    }
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (tableView==self.myTableView) {
        F37StateObj * obj = (F37StateObj*)[dataArr objectAtIndex:[indexPath row]];
        remarks.text = [obj getRemark];
        floorID = [indexPath row];
        [zhengChangB setBackgroundImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
        [guZhangB setBackgroundImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
        if ([[self.allShowDataArr objectAtIndex:indexPath.row]isEqualToString:@"可对装饰物品"]) {
            [_duiZhaoArray removeAllObjects];
            _duiZhaoArray =[[NSMutableArray alloc]initWithArray:self.duiZhaoArray1];
            [_duiZhaoTableView reloadData];
            self.rightBarBtn.hidden=NO;
        } else if ([[self.allShowDataArr objectAtIndex:indexPath.row]isEqualToString:@"整理品种书籍"]){
            [_duiZhaoArray removeAllObjects];
            self.rightBarBtn.hidden=NO;
            _duiZhaoArray =[[NSMutableArray alloc]initWithArray:self.duiZhaoArray2];
            [_duiZhaoTableView reloadData];
        }else if ([[self.allShowDataArr objectAtIndex:indexPath.row]isEqualToString:@"会务用品情况"]) {
            [_duiZhaoArray removeAllObjects];
            self.rightBarBtn.hidden=NO;
            _duiZhaoArray =[[NSMutableArray alloc]initWithArray:self.duiZhaoArray3];
            [_duiZhaoTableView reloadData];
        }else
        {
            self.rightBarBtn.hidden=YES;
            _duiZhaoTableView.hidden=YES;
        }
    }
}
#pragma mark---Request
-(void)sendRequest
{
    ASIHTTPRequest*request =[ASIHTTPRequest requestWithURL:[NSURL URLWithString:BOOKURL]];
    request.delegate=self;
    [request setDidFinishSelector:@selector(bookRequestFinished:)];
    [request startAsynchronous];
}
-(void)sendConferenceRequest
{
    ASIHTTPRequest*request =[ASIHTTPRequest requestWithURL:[NSURL URLWithString:Conference]];
    request.delegate=self;
    [request setDidFinishSelector:@selector(newRequest:)];
    [request startAsynchronous];
}
-(void)newRequest:(ASIHTTPRequest*)request
{
    NSDictionary*dic =[[request responseString] objectFromJSONString];
    NSArray *arr =[dic objectForKey:@"data"];

    NSMutableArray *subNameArr=[[NSMutableArray alloc]initWithCapacity:0];
    NSMutableArray *subNumArr=[[NSMutableArray alloc]initWithCapacity:0];
    for (NSDictionary *subDic in arr) {
        NSString *name =[subDic objectForKey:@"goodsName"];
        NSString *num =[subDic objectForKey:@"num"];
        [subNameArr addObject:name];
        [subNumArr addObject:num];
    }
    NSDictionary *dic6 =[[NSDictionary alloc]initWithObjectsAndKeys:subNameArr,@"goodsName",subNumArr,@"num", nil];
    [subNumArr release];[subNameArr release];
    [self.duiZhaoArray3 addObject:dic6];

    [dic6 release];
}
-(void)bookRequestFinished:(ASIHTTPRequest *)request
{
    NSDictionary*dic =[[request responseString] objectFromJSONString];
    NSArray *arr =[dic objectForKey:@"data"];

    NSMutableArray *subNameArr=[[NSMutableArray alloc]initWithCapacity:0];
    NSMutableArray *subNumArr=[[NSMutableArray alloc]initWithCapacity:0];
    for (NSDictionary *subDic in arr) {
        NSString *name =[subDic objectForKey:@"bookName"];
        NSString *num =[subDic objectForKey:@"num"];
        [subNameArr addObject:name];
        [subNumArr addObject:num];
    }
    NSDictionary *dic6 =[[NSDictionary alloc]initWithObjectsAndKeys:subNameArr,@"goodsName",subNumArr,@"num", nil];
    [subNumArr release];[subNameArr release];
    [self.duiZhaoArray2 addObject:dic6];
 
    [dic6 release];
}
-(void)addMyArray
{
    self.duiZhaoArray1 =[[NSMutableArray alloc]initWithCapacity:0];
    self.duiZhaoArray2 =[[NSMutableArray alloc]initWithCapacity:0];
    self.duiZhaoArray3 =[[NSMutableArray alloc]initWithCapacity:0];
    NSArray *arr1 =[[NSArray alloc]initWithObjects:@"瓷器花瓶", @"小幅瓷画",@"玉壶",@"红木牛",@"瓷瓶",@"象牙屏风",@"扇",@"青铜器(羊、牛、鼎、麒麟)",@"金器(钥匙、五牛、开拓者、如意)",@"玻璃碗",nil];
    NSArray *arr1Sub =[[NSArray alloc]initWithObjects:@"1个",@"1幅",@"2只",@"1只",@"2只",@"1只",@"1把",@"4只",@"4件",@"1只", nil];
    NSArray *arr2 =[[NSArray alloc]initWithObjects:@"假花",@"红色瓷花瓶", nil];
    NSArray *arr2Sub =[[NSArray alloc]initWithObjects:@"1盆",@"1只", nil];
    NSArray *arr3= [[NSArray alloc]initWithObjects:@"帆船、水晶球连底座",@"花瓶连底座",@"壁画",@"假花",@"XO(ROYAL CROWN-大四小)-5",@"ROSE MOUNT-1、XO(EXTRA)-1",@"GLEANS-2、克普顿XO白兰地-1",@"XO 马爹利-1、XO(地球仪)-1",@"玫娜城堡干红-1、CHIVAS REGAL-1",@"Hennessy V.S.O.P(假酒)-1、张裕香槟-1",@"GOLD PARIS-1、张裕干红-1",@"XO 酒杯-4、烈口杯-2、红酒杯-2,香槟杯-2",@"高脚杯-8",@"花茶-8、咖啡-6",nil];
    NSArray *arr3Sub =[[NSArray alloc]initWithObjects:@"各一只",@"1只",@"1幅",@"1盆",@"共5瓶",@"共2瓶",@"共3瓶",@"共2瓶",@"共2瓶",@"共2瓶",@"共2瓶",@"共10只",@"共8只",@"共14盒", nil];
    NSArray *arr4 =[[NSArray alloc]initWithObjects:@"XO酒杯-2、威士忌杯-1、高脚杯-1", nil];
    NSArray *subArr4 =[[NSArray alloc]initWithObjects:@"共4只", nil];
    NSArray *arr5 =[[NSArray alloc]initWithObjects:@"瓷器花瓶练习作",@"壁画", nil];
    NSArray *arr5Sub =[[NSArray alloc]initWithObjects:@"一只",@"2幅", nil];
    NSArray *arr6 =[[NSArray alloc]initWithObjects:@"壁画", nil];
    NSArray *arr6Sub =[[NSArray alloc]initWithObjects:@"1幅", nil];
    NSArray *arr7=[[NSArray alloc]initWithObjects:@"瓷器花瓶", nil];
    NSArray *arr7Sub=[[NSArray alloc]initWithObjects:@"2只", nil];
    
    NSDictionary *dic1 =[[NSDictionary alloc]initWithObjectsAndKeys:arr1,@"goodsName",arr1Sub,@"num",nil];
    [arr1 release];[arr1Sub release];
    NSDictionary *dic2 =[[NSDictionary alloc]initWithObjectsAndKeys:arr2,@"goodsName",arr2Sub,@"num", nil];
    [arr2 release];[arr2Sub release];
    NSDictionary *dic3 =[[NSDictionary alloc]initWithObjectsAndKeys:arr3,@"goodsName",arr3Sub,@"num", nil];
    [arr3 release];[arr3Sub release];
    NSDictionary *dic4 =[[NSDictionary alloc]initWithObjectsAndKeys:arr4,@"goodsName",subArr4,@"num", nil];
    [arr4 release];[subArr4 release];
    NSDictionary *dic5 =[[NSDictionary alloc]initWithObjectsAndKeys:arr5,@"goodsName",arr5Sub,@"num", nil];
    [arr5 release];[arr5Sub release];
    NSDictionary *dic6 =[[NSDictionary alloc]initWithObjectsAndKeys:arr6,@"goodsName",arr6Sub,@"num", nil];
    [arr6 release];[arr6Sub release];
    NSDictionary *dic7 =[[NSDictionary alloc]initWithObjectsAndKeys:arr7,@"goodsName",arr7Sub,@"num", nil];
    [arr7 release];[arr7Sub release];
    [self.duiZhaoArray1 addObject:dic1];
    [dic1 release];
    [self.duiZhaoArray1 addObject:dic2];
    [dic2 release];
    [self.duiZhaoArray1 addObject:dic3];
    [dic3 release];
    [self.duiZhaoArray1 addObject:dic4];
    [dic4 release];
    [self.duiZhaoArray1 addObject:dic5];
    [dic5 release];
    [self.duiZhaoArray1 addObject:dic6];
    [dic6 release];
    [self.duiZhaoArray1 addObject:dic7];
    [dic7 release];
    
}
-(void)addDataArray
{
    for (int i = 0; i < self.allShowDataArr.count; i++) {
        NSString * floorid = [NSString stringWithFormat:@"%d",i + 1];
        NSDictionary * floorDic = [NSDictionary dictionaryWithObjectsAndKeys:
                                   floorid,@"floorId",
                                   nil];
        
        [self.xunJianCellInfos addObject:@{@"hidden":@"1",@"floorId":[floorDic valueForKey:@"floorId"] }];
        F37StateObj * obj = [[F37StateObj alloc]init];
        [obj setState:@"1"];
        [obj setRemark:@""];
        [dataArr addObject:obj];
    }
       [self.myTableView reloadData];
}
-(void)appearCenterView:(UIButton *)send
{
    if (_duiZhaoTableView.hidden==NO) {
        self.myTableView.userInteractionEnabled=YES;
        self.backScrollV.userInteractionEnabled=YES;
        _duiZhaoTableView.hidden=YES;
        [send setBackgroundImage:[UIImage imageNamed:@"对照表"] forState:UIControlStateNormal];
    }else {
        _duiZhaoTableView.hidden=NO;
        self.myTableView.userInteractionEnabled=NO;
        self.backScrollV.userInteractionEnabled=NO;
        [send setBackgroundImage:[UIImage imageNamed:@"关闭"] forState:UIControlStateNormal];
        
    }
}
- (void)initStateView
{
    self.rightBarBtn.hidden=YES;
    UILabel * title = [[UILabel alloc]initWithFrame:CGRectMake(25, 69, 150, 40)];
    title.font = [UIFont boldSystemFontOfSize:25.0];
    title.text = @"状态：";
    [self.backScrollV addSubview:title];
    
    UILabel * zhengChang = [[UILabel alloc]initWithFrame:CGRectMake(225, 69, 150, 40)];
    zhengChang.font = [UIFont systemFontOfSize:25.0];
    zhengChang.text = @"正常";
    [self.backScrollV addSubview:zhengChang];
    
    zhengChangB = [UIButton buttonWithType:UIButtonTypeCustom];
    zhengChangB.frame = CGRectMake(175, 70, 42, 42);
    [zhengChangB setBackgroundImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
    zhengChangB.tag = 1;
    [zhengChangB addTarget:self action:@selector(selectButtonPress:) forControlEvents:UIControlEventTouchUpInside];
    [self.backScrollV addSubview:zhengChangB];
    
    UILabel * guZhang = [[UILabel alloc]initWithFrame:CGRectMake(425, 69, 150, 40)];
    guZhang.font = [UIFont systemFontOfSize:25.0];
    guZhang.text = @"故障";
    [self.backScrollV addSubview:guZhang];
    
    guZhangB = [UIButton buttonWithType:UIButtonTypeCustom];
    guZhangB.frame = CGRectMake(380, 70, 42, 42);
    [guZhangB setBackgroundImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
    guZhangB.tag = 0;
    [guZhangB addTarget:self action:@selector(selectButtonPress:) forControlEvents:UIControlEventTouchUpInside];
    [self.backScrollV addSubview:guZhangB];
    
    UILabel * rTitle = [[UILabel alloc]initWithFrame:CGRectMake(25, 130, 75, 40)];
    rTitle.font = [UIFont boldSystemFontOfSize:25.0];
    rTitle.text = @"备注：";
    [self.backScrollV addSubview:rTitle];
    
    remarks = [[UITextView alloc]initWithFrame:CGRectMake(110, 130, 450, 200)];
    remarks.editable = YES;
    remarks.scrollEnabled = YES;
    remarks.delegate = self;
    remarks.layer.borderWidth = 1;
    remarks.font = [UIFont systemFontOfSize:15.0];
    [self.backScrollV addSubview:remarks];
    //对照表    self.myTableView.frame=CGRectMake(interval111/2, 128, 0,screenHeight - blackImage.size.height - 128)
    UIImage *blackImage = [UIImage imageNamed:@"黑底"];
    _duiZhaoTableView=[[UITableView alloc]initWithFrame:CGRectMake(interval111/2,64, self.leftTableImage.size.width+self.backScrollV.frame.size.width+10,screenHeight - blackImage.size.height - 64) style:UITableViewStylePlain];
    //NSLog(@"%f %f %f",self.leftTableImage.size.width+self.backScrollV.frame.size.width+10,screenHeight - blackImage.size.height - 64,self.leftTableImage.size.height);
    _duiZhaoTableView.delegate=self;
    _duiZhaoTableView.dataSource=self;
    [self.view addSubview:_duiZhaoTableView];
    _duiZhaoTableView.hidden=YES;
}

- (void)selectButtonPress:(UIButton *)sender
{
    //stateFlag = sender.tag;
    F37StateObj * obj = (F37StateObj*)[dataArr objectAtIndex:floorID];
    [obj setState:[NSString stringWithFormat:@"%d",sender.tag]];
    if (sender.tag == 1) {
        [zhengChangB setBackgroundImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
        [guZhangB setBackgroundImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
    }
    else
    {
        [zhengChangB setBackgroundImage:[UIImage imageNamed:@"未选中.png"] forState:UIControlStateNormal];
        [guZhangB setBackgroundImage:[UIImage imageNamed:@"选中.png"] forState:UIControlStateNormal];
    }
}


- (void)textViewDidEndEditing:(UITextView *)textView
{
    F37StateObj * obj = (F37StateObj*)[dataArr objectAtIndex:floorID];
    [obj setRemark:textView.text];
    NSLog(@"%@",[obj getRemark]);
}

- (void)getFloorInfo
{
//    self.sendUrl = get37FloorInfo;
//    NSURL *sendUrl = [NSURL URLWithString:self.sendUrl];
//    floorProject = [ASIFormDataRequest requestWithURL:sendUrl];
//    floorProject.delegate=self;
//    [floorProject startSynchronous];
//    
//    NSString *response = [floorProject responseString];
//    NSDictionary * result = [response objectFromJSONString];
//    NSMutableArray * dicArr = [result objectForKey:@"data"];
    NSArray *dicArr = @[
  @{@"floorname": @"一楼大堂电子指示牌",@"floorId":@"1"},
  @{@"floorname": @"灯光照明",@"floorId":@"2"},
  @{@"floorname": @"货梯玻璃移门",@"floorId":@"3"},
  @{@"floorname": @"客梯电梯门",@"floorId":@"4"},
  @{@"floorname": @"设施设备",@"floorId":@"5"},
  @{@"floorname": @"天花吊顶",@"floorId":@"6"},
  @{@"floorname": @"墙面墙纸",@"floorId":@"7"},
  @{@"floorname": @"金砖金叶",@"floorId":@"8"},
  @{@"floorname": @"漏水渗水情况",@"floorId":@"9"},
  @{@"floorname": @"清洁卫生",@"floorId":@"10"},
  @{@"floorname": @"绿化情况",@"floorId":@"11"},
  @{@"floorname": @"洗手液",@"floorId":@"12"},
  @{@"floorname": @"卷筒纸",@"floorId":@"13"},
  @{@"floorname": @"擦手纸",@"floorId":@"14"},
  @{@"floorname": @"擦拭咖啡包茶包",@"floorId":@"15"},
  @{@"floorname": @"清洗吧台上的玻璃酒杯",@"floorId":@"16"},
  @{@"floorname": @"清洗抹布口布盖布",@"floorId":@"17"},
  @{@"floorname": @"热水器放水",@"floorId":@"18"},
  @{@"floorname": @"核对装饰物品",@"floorId":@"19"},
  @{@"floorname": @"整理品种书籍",@"floorId":@"20"},
  @{@"floorname": @"会务用品情况",@"floorId":@"21"},
  @{@"floorname": @"桌椅摆放情况",@"floorId":@"22"},
  @{@"floorname": @"窗帘关闭情况",@"floorId":@"23"},
  @{@"floorname": @"钢琴试音工作",@"floorId":@"24"}];
    NSMutableArray * floorInfoArr = [[NSMutableArray alloc]init];
    for (int i = 0; i < dicArr.count; i++)
    {
        NSDictionary * dic = [dicArr objectAtIndex:i];
        NSString * infoStr = [dic objectForKey:@"floorname"];
        [floorInfoArr addObject:infoStr];
    }
    self.allShowDataArr = floorInfoArr;
}

-(void)jajajajaj:(UIButton *)btn
{
    switch (btn.tag) {
        case 0:
        {
            NSLog(@"%@",@"提交");
            //[self loginSendData];
            if (readyNumber >= 24) {
                [self sendCheck];
            }
            NSLog(@"%d",floorID);
            NSIndexPath *path = [NSIndexPath indexPathForRow:floorID inSection:0];
            XunJianCell *cell =(XunJianCell*)[self.myTableView cellForRowAtIndexPath:path];
            if (cell.gouView.hidden) {
                cell.gouView.hidden = NO;
                
                NSString * floorIdStr = [NSString stringWithFormat:@"%d",floorID];
                [self.xunJianCellInfos replaceObjectAtIndex:path.row withObject:@{@"hidden": [NSString stringWithFormat:@"0"],@"floorId":floorIdStr}];
                readyNumber += 1;
                floorID += 1;
                NSLog(@"%d",readyNumber);
                if (readyNumber >= 24) {
                    UIButton *btndd =(UIButton*)[self.blackView viewWithTag:0];
                    [btndd setImage:[UIImage imageNamed:@"提交.png"] forState:UIControlStateNormal];
                    return;
                }
                path = [NSIndexPath indexPathForRow:readyNumber inSection:0];
                [self.myTableView selectRowAtIndexPath:path animated:YES scrollPosition:UITableViewScrollPositionMiddle];
                F37StateObj * obj = (F37StateObj*)[dataArr objectAtIndex:floorID];
                remarks.text = [obj getRemark];
            }
            NSLog(@"%d",readyNumber);
        }
            break;
            
        default:
            break;
    }
}

- (void)sendCheck
{
    //NSMutableArray * dataArr = [[NSMutableArray alloc]init];
    NSMutableArray * sendArr = [[NSMutableArray alloc]init];
    for (int i = 0; i < dataArr.count; i++) {
        F37StateObj * obj = (F37StateObj *)[dataArr objectAtIndex:i];
        NSString * checkId = [NSString stringWithFormat:@"%d",i + 1];
        NSString * isNormal = [obj getState];
        NSString * checkRemark = [[obj getRemark] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        NSDictionary * dic = [NSDictionary dictionaryWithObjectsAndKeys:checkId, @"floorId",
                              isNormal,@"status",
                              checkRemark,@"remark",
                              nil];
        [sendArr addObject:dic];
    }
    NSDictionary * final = [NSDictionary dictionaryWithObjectsAndKeys:
                            [[Appinfomation shareIstance].loginDic objectForKey:@"id"],@"userId",
                            sendArr,@"floorData",
                            nil];
    self.sendAllDic.dictionary = final;
    self.sendUrl = send37FloorInfo;

    NSString *str1 =[self.sendAllDic JSONRepresentation];
    NSURL *sendUrl = [NSURL URLWithString:self.sendUrl];
    floorProject = [ASIFormDataRequest requestWithURL:sendUrl];
    floorProject.delegate=self;
    [floorProject setPostValue:str1 forKey:@"data"];
    [floorProject startAsynchronous];
    
    [self showAlertSuccess];
}



- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
